-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(caldav): Add default reminder to attendees of scheduling messages #48226
base: master
Are you sure you want to change the base?
fix(caldav): Add default reminder to attendees of scheduling messages #48226
Conversation
Signed-off-by: Lucas Ferreira da Silva <[email protected]>
$aclPlugin = $this->server->getPlugin('acl'); | ||
|
||
// Local delivery is not available if the ACL plugin is not loaded. | ||
if (!$aclPlugin) { |
Check notice
Code scanning / Psalm
DocblockTypeContradiction Note
$aclPlugin = $this->server->getPlugin('acl'); | ||
|
||
// Local delivery is not available if the ACL plugin is not loaded. | ||
if (!$aclPlugin) { |
Check notice
Code scanning / Psalm
DocblockTypeContradiction Note
|
||
$caldavNS = '{'.self::NS_CALDAV.'}'; | ||
|
||
$principalUri = $aclPlugin->getPrincipalByUri($iTipMessage->recipient); |
Check failure
Code scanning / Psalm
UndefinedMethod Error
// | ||
// Once we support PHP 5.5, this should be wrapped in a try..finally | ||
// block so we can ensure that this privilege gets added again after. | ||
$this->server->removeListener('propFind', [$aclPlugin, 'propFind']); |
Check notice
Code scanning / Psalm
InvalidArgument Note
[$iTipMessage->sender] | ||
); | ||
} | ||
$objectNode->put($newObject->serialize()); |
Check failure
Code scanning / Psalm
UndefinedInterfaceMethod Error
[$iTipMessage->sender] | ||
); | ||
} | ||
$objectNode->put($newObject->serialize()); |
Check notice
Code scanning / Psalm
PossiblyNullReference Note
* @param ITip\Message $iTipMessage | ||
* @param int $userDefaultReminder | ||
*/ | ||
private function createAlarm(ITip\Message $iTipMessage, int $userDefaultReminder) { |
Check notice
Code scanning / Psalm
MissingReturnType Note
$alarm = $iTipMessage->message->createComponent('VALARM'); | ||
$alarm->add($iTipMessage->message->createProperty('TRIGGER', '-' . $this->secondsToIso8601Duration(abs($userDefaultReminder)), ['RELATED' => 'START'])); | ||
$alarm->add($iTipMessage->message->createProperty('ACTION', 'DISPLAY')); | ||
$iTipMessage->message->VEVENT->add($alarm); |
Check notice
Code scanning / Psalm
PossiblyNullReference Note
$alarm = $iTipMessage->message->createComponent('VALARM'); | ||
$alarm->add($iTipMessage->message->createProperty('TRIGGER', '-' . $this->secondsToIso8601Duration(abs($userDefaultReminder)), ['RELATED' => 'START'])); | ||
$alarm->add($iTipMessage->message->createProperty('ACTION', 'DISPLAY')); | ||
$iTipMessage->message->VEVENT->add($alarm); |
Check failure
Code scanning / Psalm
InvalidArgument Error
$userDefaultReminder = $this->config->getUserValue($user->getUID(), 'calendar', 'defaultReminder', 'none'); | ||
// If the user hasn't changed the default reminder, it will use the global one | ||
if ($userDefaultReminder === 'none') { | ||
$userDefaultReminder = $this->config->getAppValue('calendar', 'defaultReminder', 'none'); |
Check notice
Code scanning / Psalm
DeprecatedMethod Note
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
Nice one, I will take a look soon! |
Morning @lufer22 Thanks for you effort on this! The code looks good but I do see a logic issue.
I will see if there is another option to this, this weekend when I have more time. |
Summary
The attendees of new scheduled events now have the attendee default reminder set.
TODO
Checklist